<%@ page language="java" isELIgnored="false" import="java.util.*"
	pageEncoding="UTF-8" contentType="text/html; charset=UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type">

<link rel="stylesheet" type="text/css" href="<%=request.getContextPath() %>/css/grid.css"/>
<link rel="stylesheet" type="text/css" href="<%=request.getContextPath() %>/css/public.css"/>

<c:if test="${not empty pageComponent }">
<div id="grid-page-toolbar" cellspacing="0" cellpadding="0" class="grid-bottom-toolbar">
<div class="display-text"><s:text name="paging.show"/> <span class="record-start">${pageComponent.startPoint}</span> -
<span class="record-end">${pageComponent.endPoint}</span><s:text name="paging.all"/>，<s:text name="paging.total"/>  <span class="record-amount">${pageComponent.totalCount}</span>
</span><s:text name="paging.all"/></div>
<div class="page-navigator">
<table cellspacing="0" cellpadding="0" border="0">
	<tbody>
		<tr align="center">
			<td width="18">
			<s:if test="pageComponent.currentPageNo != 1">
				<a href="${pageComponent.firstPageUrl}" onclick="jumpTo('first')"><img src="<%=request.getContextPath() %>/images/ico16/ico-page-first.gif"></a>
			</s:if>
			<s:else>
				<a href="javascript:void(0);"><img src="<%=request.getContextPath() %>/images/ico16/ico-page-first-disabled.gif"></a>
			</s:else>
			</td>
			<td width="18">
			<s:if test="pageComponent.hasPreviousPage">
				<a href="${pageComponent.prePageUrl}" onclick="jumpTo('pre')"><img src="<%=request.getContextPath() %>/images/ico16/ico-page-prev.gif"></a>
			</s:if>
			<s:else>
				<a href="javascript:void(0);"><img src="<%=request.getContextPath() %>/images/ico16/ico-page-prev-disabled.gif"></a>
			</s:else>
			</td>
			<td width="18">
			<s:if test="pageComponent.hasNextPage">
				<a href="${pageComponent.nextPageUrl}" onclick="jumpTo('next')"><img src="<%=request.getContextPath() %>/images/ico16/ico-page-next.gif"></a>
			</s:if>
			<s:else>
				<a href="javascript:void(0);"><img src="<%=request.getContextPath() %>/images/ico16/ico-page-next-disabled.gif"></a>
			</s:else>
			</td>
			<td width="18">
			<s:if test="pageComponent.currentPageNo < pageComponent.totalPageCount">
				<a href="${pageComponent.lastPageUrl}" onclick="jumpTo('last')"><img src="<%=request.getContextPath() %>/images/ico16/ico-page-last.gif"></a>
			</s:if>
			<s:else>
				<a href="javascript:void(0);"><img src="<%=request.getContextPath() %>/images/ico16/ico-page-last-disabled.gif"></a>
			</s:else>
			</td>
			<td width="10" class="page-seperator">|</td>
			<td width="48"><s:text name="paging.pageNo"/>：</td>
			<td width="20"><input type="text" value="${pageComponent.currentPageNo}" onblur="pageNoInputOnBlur(this.value);" onfocus="pageNoInputOnFocus(this.value);" id="page-number" class="page-number"></td>
			<td width="10">/</td>
			<td width="15"><span class="total-page-size">${pageComponent.totalPageCount}</span></td>
			<td width="50">
			<div class="grid-btn-order" onclick="redirctTo()">
			<ul>
				<li class="left-normal"></li>
				<li class="middle-normal"><s:text name="paging.goto"/></li>
				<li class="right-normal"></li>
			</ul>
			</div>
			</td>
		</tr>
	</tbody>
</table>
</div>
</div>
<script type="text/javascript">

var origPageNo = ${pageComponent.currentPageNo};
function redirctTo(){
	/* if(flag && flag =='zqhxsz'){
		jumpTo('jump');
	}else{ */
		 var inputPageNo = $("#page-number").val();
		  if( inputPageNo == ${pageComponent.currentPageNo})return;
		  window.location.href = "${pageComponent.noPageNoPageUrl}"+inputPageNo;
	/* } */
 
  
}

function pageNoInputOnBlur(value){
   if(value<1 || value > ${pageComponent.totalPageCount}){
      $("#page-number").val(origPageNo);
      return;
   }
}

function pageNoInputOnFocus(value){
   origPageNo = value;
}

window.onload = function(){
   //var $pageBar = $("#grid-page-toolbar");
   
};
/* $(function(){
	if(flag && flag =='zqhxsz'){
		$("table a").removeAttr("href","");
	}
	
}); */
function jumpTo(action){
	
	//alert('hahaha');
	
	var inputPageNo = $("#page-number").val();
	 if(action == 'first'){
		 $("#currentPageNo").val('1');	 
	 }else if(action == 'pre'){
		 $("#currentPageNo").val(parseInt(inputPageNo)-1);	 
	 }else if(action == 'next'){
		 $("#currentPageNo").val(parseInt(inputPageNo)+1);	
	 }else if(action == 'last'){
		 $("#currentPageNo").val($(".total-page-size").text());	
		 //alert( $("#currentPageNo").val());
	 }else if(action =='jump'){
		 $("#currentPageNo").val(inputPageNo);	
	 }
	   
	    var toCity = $("#toCity2").val();
	    var fromCity = $("#fromCity2").val();
		var formDateNumber=$.trim($("#formDateNumber2").val());
		var toDateNumber=$.trim($("#toDateNumber2").val());
	    var grabChannel2 = $("#grabChannel2").val();
	    var validityFromStr   = $("#grapDate").val();
	   /*  $("#currentPageNo").val(inputPageNo); */
	    $("#showTaskInfoListForm").submit();
	    // window.location.href = "${pageComponent.noPageNoPageUrl}"+inputPageNo+"&toCity="+toCity+"&fromCity="+fromCity+"&formDateNumber="+formDateNumber+"&toDateNumber="+toDateNumber+"&validityFromStr="+validityFromStr;
	    
}

</script>
</c:if>